package com.bm.server.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bm.server.dto.UinfoDto;
import com.bm.server.dto.UserinfoDto;
import com.bm.server.entity.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;



public interface UserInfoDao extends BaseMapper<UserInfo> {
    @Select("SELECT t.uid, t.nickName, t.headurl, t.sex, t.occupation, t.signature, t.label FROM t_userinfo as t")
    List<UserinfoDto> selectall();

    @Select("select * from t_userinfo where uid = #{uid}")
    UinfoDto selectAll(Integer uid);
    //修改
    @Update("update t_userinfo set nickName=#{nickName}, headurl=#{headurl}, birthday=#{birthday}, sex=#{sex}, hometown=#{hometown}, occupation=#{occupation}, signature=#{signature}, label=#{label} where uid = #{uid}")
    int updateUserInfo(@Param("uid") Integer uid, @Param("nickName") String nickName, @Param("headurl") String headurl, @Param("birthday") Date birthday, @Param("sex") String sex,
                   @Param("hometown") String hometown,@Param("occupation") String occupation,@Param("signature") String signature,@Param("label") String label);



}
